package com.btpj.jetpack.arouter.search

import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Autowired
import com.alibaba.android.arouter.launcher.ARouter
import com.btpj.jetpack.arouter.ConstantsPath

class SearchServiceWrap private constructor() {

    @Autowired(name = ConstantsPath.SEARCH_SERVICE_PATH)
    lateinit var service: SearchService

    companion object {

        val instance: SearchServiceWrap by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) {
            SearchServiceWrap()
        }
    }

    init {
        ARouter.getInstance().inject(this)
    }

    fun start(context: Context) {
        service.start(context)
    }
}